import React from 'react'
// ===================================================================== global declare
const { $fn, $Lazy } = window
// ===================================================================== Lazy
const Modal =  $Lazy.state(()=>import('@antd/modal'))
const Image =  $Lazy.state(()=>import('@tp/image'))
// ===================================================================== component
class Index extends React.Component{
	state = {
		data:{},
	}
	
	model = {}
	
	open = ({ uuid }) => {
		this.modal.open()
		window.$http.submit(null, 'bill/viewpic', { param: {uuid}, isPull:true } ).then(data=>{
			this.setState({data})
		})
	}

	render(){
		const { data } = this.state
		return (
			<Modal
				title		= '查看其它'
				width 		= { 800 }
				onRef		= { ref => this.modal = ref }
				noFooter
			>
				<div className='fx mb10'>
					<div className='tr g6' style={{width:50}}>原因:</div>
					<div className='bor1 ex ml10 r5px p10' style={{height:120,background:'#f5f5f5'}}>{data.reason}</div>
				</div>
				<div className='fx'>   
					<div className='tr g6' style={{width:50}}>图片:</div>
					<div className='bor1 ex ml10 r5px p10 fxmc' style={{minHeight:200}}>
						{
							data.img 	? <Image src={$fn.getImagePrefix(data?.img)} style={{maxWidth:'100%'}} />
										: <div className='f12 g9 tc'>暂无图片</div>
						}
						
					</div>
				</div>
				<div className='h15'></div>
			</Modal>
		)
	}
}

export default Index